package com.dabay.web.controller;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpSession;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import com.dabay.web.Model.Bybt;
import com.dabay.web.Model.Dept;
import com.dabay.web.Model.Dmsj;
import com.dabay.web.Model.GangWei;
import com.dabay.web.Model.Sbbt;
import com.dabay.web.service.WebService;
import com.dabay.web.util.Helper;
import com.dabay.web.util.ResultSupport;
import com.dabay.web.util.ResultSupportWork;

import net.sf.json.JSONObject;

@Controller
@RequestMapping("/nbwx/m")
public class WebController_work {
	private WebService wbService = new WebService();
	private Helper helper = new Helper();
	private static final Log log = LogFactory.getLog(WebController_home.class);
	
	@ResponseBody
	@RequestMapping(value = "/ly_test")
	public ModelAndView ly_test(){
		ModelAndView mv = new ModelAndView();
		mv.setViewName("ly_test");
		return mv;
	}
	/**
	 * 就业创业首页
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value = "/jycy_index")
	public ModelAndView jycy_index(
			@RequestParam(required = false) String userName,
			@RequestParam(required = false) String idNum,
			@RequestParam(required = false) String type,
			HttpSession session){	
		ModelAndView mv = new ModelAndView();
		log.info("转码前--------用户身份信息-----------------用户名："+userName);
		log.info("转码前--------用户身份信息-----------------身份证："+idNum);
		userName = helper.encodeStr(userName);
		idNum = helper.encodeStr(idNum);
		log.info("转码后--------用户身份信息-----------------用户名："+userName);
		log.info("转码后--------用户身份信息-----------------身份证："+idNum);
/*		userName = "方园";
		idNum = "330203199111080646";*/
/*		userName = "张晶";
		idNum = "330102197002231539";*/
		session.setAttribute("USERNAME", userName);
		session.setAttribute("IDNUM", idNum);
		String viewName ="jycy_index";
		if("work".equals(type)){
			viewName="jycy_index_work";
		}
		if("yaopin".equals(type)){
			viewName="jycy_index_yaopin";
		}
		if("yiliao".equals(type)){
			viewName="jycy_index_yiliao";
		}
		mv.setViewName(viewName);
		return mv;
	}
	
	
	/**
	 * 跳转到创业就业社保操作页面
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value = "/items")
	public ModelAndView items(@RequestParam(required = false) String item,
			HttpSession session){	
		ModelAndView mv = new ModelAndView();
		String name = (String)session.getAttribute("USERNAME");
		String sfzh = (String)session.getAttribute("IDNUM");
		if("1".endsWith(item)){
/*			ResultSupportWork<Object> resultSupport =wbService.send_cyzsbbt("SFZ","330102197002231539※张晶");*/
			ResultSupportWork<Object> resultSupport =wbService.send_cyzsbbt("SFZ",sfzh+"※"+name);
			List<Sbbt> dataList = (List<Sbbt>)resultSupport.getModel();
				mv.addObject("cybtList",dataList);
				mv.setViewName("cyshebaobutie_list");
		}
		else if("2".endsWith(item)){
/*			ResultSupportWork<Object> resultSupport =wbService.send_gxsbybt("SFZ","330203199111080646※方园");*/
			ResultSupportWork<Object> resultSupport =wbService.send_gxsbybt("SFZ",sfzh+"※"+name);
			List<Bybt> bybtList = (List<Bybt>)resultSupport.getModel();
			mv.addObject("bybtList",bybtList);
			mv.setViewName("gxjiuyebutie_list");
		}else if("3".endsWith(item)){
			mv.setViewName("gangweibutie");
		}else if("4".endsWith(item)){
			List<Dmsj> xueLiList = new ArrayList<Dmsj>();
			xueLiList = (List<Dmsj>) wbService.dm_query("AAC011","").getModel();
			mv.addObject("xueLiList",xueLiList);
			mv.setViewName("jiuyegangweiinfo");
		}		
		return mv;
	}
	
	/**
	 * 跳转创业社保补贴详情页面页面
	 *	AAB003		组织机构代码
	 * 	BBC017		内码；新增时，为空。非独立数据
	 *	R0005R		本人承诺以上信息填报属实；{1/是，0/否}
	 *	R0005Q		月均纳税额达500元；{1/是，0/否}
	 *	R0005P		参保满12个月；{1/是，0/否}
	 *	R0004B		人员类别
	 *	R0004D		手机号码
	 *	AAC003		姓名
	 *	AAC002		身份证
	 *	AAE006		申报地点
	 *	R00048		成立日期
	 *	AAE004		单位全称
	 *	R00046		创业类型
	 *	SHZT        审核状态
	 * 	SHR  		审核人
	 */
	@ResponseBody
	@RequestMapping(value = "/to_cy_details")
	public ModelAndView to_cy_details (
			@RequestParam(required = false) String BBC017,	
			@RequestParam(required = false) String AAB003,
			@RequestParam(required = false) String R0005R,
			@RequestParam(required = false) String R0005Q,
			@RequestParam(required = false) String R0005P,
			@RequestParam(required = false) String R0004B,
			@RequestParam(required = false) String R0004D,
			@RequestParam(required = false) String AAC003,
			@RequestParam(required = false) String AAC002,
			@RequestParam(required = false) String AAE006,
			@RequestParam(required = false) String R00048,
			@RequestParam(required = false) String AAE004,
			@RequestParam(required = false) String R00046,
			@RequestParam(required = false) String SHZT,
			@RequestParam(required = false) String SHR){
		ModelAndView mv = new ModelAndView();
		mv.setViewName("cyshebaobutie_detail");
		String cylxName = "";
		String rylbName = "";
		BBC017 = BBC017.toUpperCase();
		AAE006 = AAE006.toUpperCase();
		if("01".equals(R00046)){
			cylxName = "企业";
		}
		else if("02".equals(R00046)){
			cylxName = "个体商户";
		}
		else if("11".equals(R00046)){
			cylxName = "网络创业";
		}
		else if("12".equals(R00046)){
			cylxName = "村级电商";
		}
		else{
			cylxName = "非上述类型";
		}
		mv.addObject("cylxName",cylxName);
		
		//查询人员类别
		ResultSupportWork<Object> rylb_res =  wbService.dm_query("R0004B","");
		List<Dmsj> rylbList = (List<Dmsj>)rylb_res.getModel();
		mv.addObject("rylbList",rylbList);
		
		//根据地区编码查询地区名字
		ResultSupportWork<Object> dq_res = wbService.queryDept("JB",AAE006+"※"+3+"※"+"1");
		List<Dept> dqList = (List)dq_res.getModel();
		String sbdqName = dqList.get(0).getAab300();
		mv.addObject("sbdqName",sbdqName);
		
		mv.addObject("BBC017",BBC017);
		mv.addObject("AAB003",AAB003);	
		mv.addObject("R0005R",R0005R);	
		mv.addObject("R0005Q",R0005Q);
		mv.addObject("R0005P",R0005P);
		mv.addObject("R0004B",R0004B);
		mv.addObject("R0004D",R0004D);
		mv.addObject("AAC003",AAC003);
		mv.addObject("AAC002",AAC002);
		mv.addObject("AAE006",AAE006);
		mv.addObject("R00048",R00048);
		mv.addObject("AAE004",AAE004);
		mv.addObject("R00046",R00046);
		mv.addObject("SHZT",SHZT);
		mv.addObject("SHR",SHR);
		mv.addObject("R0005P",R0005P.trim());
		mv.addObject("R0005Q",R0005Q.trim());
		mv.addObject("R0005R",R0005R.trim());
		mv.addObject("R00046",R00046);
		mv.addObject("SHZT",SHZT);
		mv.addObject("SHR",SHR);
		return mv;
	}
	
	/**
	 * 跳转创业社保补贴修改页面
	 *	R0004H		申报月起
	 *	R0004J		申报月止
	 *
	 *	AAB003		组织机构代码
	 * 	BBC017		内码；新增时，为空。非独立数据
	 *	R0005R		本人承诺以上信息填报属实；{1/是，0/否}
	 *	R0005Q		月均纳税额达500元；{1/是，0/否}
	 *	R0005P		参保满12个月；{1/是，0/否}
	 *	R0004B		人员类别
	 *	R0004D		手机号码
	 *	AAC003		姓名
	 *	AAC002		身份证
	 *	AAE006		申报地点
	 *	R00048		成立日期
	 *	AAE004		单位全称
	 *	R00046		创业类型
	 *	SHZT        审核状态
	 * 	SHR  		审核人
	 */
	@ResponseBody
	@RequestMapping(value = "/to_cy_xiugai")
	public ModelAndView to_cy_xiugai (
			@RequestParam(required = false) String BBC017,	
			@RequestParam(required = false) String AAB003,
			@RequestParam(required = false) String R0005R,
			@RequestParam(required = false) String R0005Q,
			@RequestParam(required = false) String R0005P,
			@RequestParam(required = false) String R0004B,
			@RequestParam(required = false) String R0004D,
			@RequestParam(required = false) String AAC003,
			@RequestParam(required = false) String AAC002,
			@RequestParam(required = false) String AAE006,
			@RequestParam(required = false) String R00048,
			@RequestParam(required = false) String AAE004,
			@RequestParam(required = false) String R00046,
			@RequestParam(required = false) String SHZT,
			@RequestParam(required = false) String SHR){
		ModelAndView mv = new ModelAndView();
		mv.setViewName("cyshebaobutie_xg");
		BBC017 = BBC017.toUpperCase();
		AAE006 = AAE006.toUpperCase();
		
		//根据地区编码查询地区名字
		ResultSupportWork<Object> dq_res = wbService.queryDept("JB",AAE006+"※"+3+"※"+"1");
		List<Dept> dqList = (List)dq_res.getModel();
		String sbdqName = dqList.get(0).getAab300();
		mv.addObject("sbdqName",sbdqName);
		
		mv.addObject("BBC017",BBC017);
		mv.addObject("AAB003",AAB003);	
		mv.addObject("R0005R",R0005R);	
		mv.addObject("R0005Q",R0005Q);
		mv.addObject("R0005P",R0005P);
		mv.addObject("R0004B",R0004B);
		mv.addObject("R0004D",R0004D);
		mv.addObject("AAC003",AAC003);
		mv.addObject("AAC002",AAC002);
		mv.addObject("AAE006",AAE006);
		mv.addObject("R00048",R00048);
		mv.addObject("AAE004",AAE004);
		mv.addObject("R00046",R00046);
		mv.addObject("SHZT",SHZT);
		mv.addObject("SHR",SHR);		
		mv.addObject("R0005P",R0005P.trim());
		mv.addObject("R0005Q",R0005Q.trim());
		mv.addObject("R0005R",R0005R.trim());
		mv.addObject("R00046",R00046);
		mv.addObject("SHZT",SHZT);
		mv.addObject("SHR",SHR);
		return mv;
	}
	
	
	/**
	 * 跳转到高校就业补贴详情页面
	 * bbc017	内码；新增时，为空。非独立数据
	 * aae017	申报区域
	 * aae004	单位全称     指：社保参保单位名称
	 * aab003	组织机构代码  注：单位全称+组织机构代码用于单位定位
	 * aab007	营业执照号    注：五证合一后，可以不填写；用于工商数据比对
	 * aac002 	身份证
	 * aac003	姓名
	 * bbc018 	毕业学校
	 * bbc023  	学历 {11/博士；12/硕士；21/大学；31/大专}
	 * bbc019  	毕业日期
	 * bbc022	人员类别 {101/宁波生源；102/非宁波生源；103/协议学校}
	 * r0005r	本人承诺以上信息填报属实；{1/是，0/否}
	 * shzt		审核状态；{01/预审；02/预审不通过；03/预审补件；21/受理；31/审核通过；50/办结；91/不受理办结}
	 * shr		审核人
	 * 
	 */
	@ResponseBody
	@RequestMapping(value = "/to_jy_details")
	public ModelAndView to_jy_details (		
			@RequestParam(required = false) String BBC017,
			@RequestParam(required = false) String AAE017,	
			@RequestParam(required = false) String AAE004,	
			@RequestParam(required = false) String AAB003,
			@RequestParam(required = false) String AAB007,
			@RequestParam(required = false) String AAC002,
			@RequestParam(required = false) String AAC003,
			@RequestParam(required = false) String BBC018,
			@RequestParam(required = false) String BBC023,
			@RequestParam(required = false) String BBC019,
			@RequestParam(required = false) String BBC022,
			@RequestParam(required = false) String R0005R,
			@RequestParam(required = false) String SHZT,
			@RequestParam(required = false) String SHR
			){
		ModelAndView mv = new ModelAndView();
		mv.setViewName("gxjiuyebutie_detail");
		//根据地区编码查询地区名字
		String sbdqName = "";
		ResultSupportWork<Object> dq_res = wbService.queryDept("GX_JYBT_01","");
		List<Dept> dqList = (List)dq_res.getModel();
		for(int i=0;i<dqList.size();i++){
			if(dqList.get(i).getBsc001().equals(AAE017)){
				sbdqName = dqList.get(i).getBsc001();
			}
		}
		AAE017 = AAE017.toUpperCase();
		BBC017 = BBC017.toUpperCase();
		AAB003 = AAB003.toUpperCase();
		mv.addObject("sbdqName",sbdqName);
		mv.addObject("BBC017",BBC017);
		mv.addObject("AAE017",AAE017);
		mv.addObject("AAE004",AAE004);		
		mv.addObject("AAB003",AAB003);
		mv.addObject("AAB007",AAB007);
		mv.addObject("AAC002",AAC002);
		mv.addObject("AAC003",AAC003);
		mv.addObject("BBC018",BBC018);
		mv.addObject("BBC023",BBC023);
		mv.addObject("BBC019",BBC019);
		mv.addObject("BBC022",BBC022);
		mv.addObject("R0005R",R0005R.trim());
		mv.addObject("SHZT",SHZT);
		mv.addObject("SHR",SHR);
		return mv;
	}
	
	/**
	 * 跳转到高校就业补贴修改页面
	 * bbc017	内码；新增时，为空。非独立数据
	 * aae017	申报区域
	 * aae004	单位全称     指：社保参保单位名称
	 * aab003	组织机构代码  注：单位全称+组织机构代码用于单位定位
	 * aab007	营业执照号    注：五证合一后，可以不填写；用于工商数据比对
	 * aac002 	身份证
	 * aac003	姓名
	 * bbc018 	毕业学校
	 * bbc023  	学历 {11/博士；12/硕士；21/大学；31/大专}
	 * bbc019  	毕业日期
	 * bbc022	人员类别 {101/宁波生源；102/非宁波生源；103/协议学校}
	 * r0005r	本人承诺以上信息填报属实；{1/是，0/否}
	 * shzt		审核状态；{01/预审；02/预审不通过；03/预审补件；21/受理；31/审核通过；50/办结；91/不受理办结}
	 * shr		审核人
	 * 
	 */
	@ResponseBody
	@RequestMapping(value = "/to_jy_xiugai")
	public ModelAndView to_jy_xiugai (		
			@RequestParam(required = false) String BBC017,
			@RequestParam(required = false) String AAE017,	
			@RequestParam(required = false) String AAE004,	
			@RequestParam(required = false) String AAB003,
			@RequestParam(required = false) String AAB007,
			@RequestParam(required = false) String AAC002,
			@RequestParam(required = false) String AAC003,
			@RequestParam(required = false) String BBC018,
			@RequestParam(required = false) String BBC023,
			@RequestParam(required = false) String BBC019,
			@RequestParam(required = false) String BBC022,
			@RequestParam(required = false) String R0005R,
			@RequestParam(required = false) String SHZT,
			@RequestParam(required = false) String SHR
			){
		ModelAndView mv = new ModelAndView();
		mv.setViewName("gxjiuyebutie_xg");
		//根据地区编码查询地区名字
		String sbdqName = "";
		ResultSupportWork<Object> dq_res = wbService.queryDept("GX_JYBT_01","");
		List<Dept> dqList = (List)dq_res.getModel();
		for(int i=0;i<dqList.size();i++){
			String name = dqList.get(i).getBsc001();
			if(name.equals(AAE017)){
				sbdqName = dqList.get(i).getAab300();
				System.out.println("好了");
				break;
			}
		}
		AAE017 = AAE017.toUpperCase();
		BBC017 = BBC017.toUpperCase();
		AAB003 = AAB003.toUpperCase();
		mv.addObject("sbdqName",sbdqName);
		mv.addObject("BBC017",BBC017);
		mv.addObject("AAE017",AAE017);
		mv.addObject("AAE004",AAE004);		
		mv.addObject("AAB003",AAB003);
		mv.addObject("AAB007",AAB007);
		mv.addObject("AAC002",AAC002);
		mv.addObject("AAC003",AAC003);
		mv.addObject("BBC018",BBC018);
		mv.addObject("BBC023",BBC023);
		mv.addObject("BBC019",BBC019);
		mv.addObject("BBC022",BBC022);
		mv.addObject("R0005R",R0005R.trim());
		mv.addObject("SHZT",SHZT);
		mv.addObject("SHR",SHR);
		return mv;
	}
	
	/**
	 * 查询地区
	 * @param hm   地区id
	 * @param area_level   查询地区级别
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value = "/area_select")
	public  ResultSupportWork<Object> area_select(String lx,String hm,String area_level,String type){
		ResultSupportWork<Object> result = null;
		if("GX_JYBT_01".equals(lx)){
			result = wbService.queryDept(lx,"");
		}
		else{
			result = wbService.queryDept(lx,hm+"※"+area_level+"※"+type);
		}	
		return result;
		
	}
	
	/**
	 * 跳转到创业社保补贴在线提交
	 * @param area_id
	 * @param area_name
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value = "/to_cy_zxsq")
	public  ModelAndView to_cy_zxtj(@RequestParam(required = false) String area_id,
			@RequestParam(required = false) String area_name){
		ModelAndView mv = new ModelAndView();
		mv.setViewName("cyshebaobutie_zxsq2");
		ResultSupportWork<Object> cylx_res =  wbService.dm_query("R00046","");
		List<Dmsj> cylxList = (List<Dmsj>)cylx_res.getModel();
		mv.addObject("cylxList",cylxList);
		
		ResultSupportWork<Object> rylb_res =  wbService.dm_query("R0004B","");
		List<Dmsj> rylbList = (List<Dmsj>)rylb_res.getModel();
		mv.addObject("rylbList",rylbList);
		mv.addObject("area_id",area_id);
		mv.addObject("area_name",area_name);
		return mv;
	}
	
	/**
	 * 跳转到高校就业社保补贴在线提交
	 * @param area_id
	 * @param area_name
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value = "/to_jy_zxsq")
	public  ModelAndView to_jy_zxsq(@RequestParam(required = false) String area_id,
			@RequestParam(required = false) String area_name,
			@RequestParam(required = false) String byyx){
		log.info("test:"+area_name+","+byyx+"------------------------------");
		ModelAndView mv = new ModelAndView();
		mv.setViewName("gxjiuyebutie_zxsq2");
		mv.addObject("area_id",area_id);
		mv.addObject("area_name",area_name);
		mv.addObject("byyx",byyx);
		return mv;
	}
	
	/**
	 * 创业者社保补贴在线申请（数据报送）
	 * @param AAB003
	 * @param R0005R
	 * @param R0005Q
	 * @param R0005P
	 * @param R0004B
	 * @param R0004D
	 * @param AAC003
	 * @param AAC002
	 * @param AAE006
	 * @param R00048
	 * @param AAE004
	 * @param R00046
	 * @param SHZT
	 * @param SHR
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value = "/cy_zxsq",method = RequestMethod.POST)
	public  ResultSupportWork<Object> cy_zxsq(
			@ModelAttribute("Sbbt")Sbbt sbbt){
		sbbt.setR00048(sbbt.getR00048().replace("-", ""));
		ResultSupportWork<Object> result = null;
		result = wbService.commit_cyzsbbt(sbbt);
		return result;
	}
	
	/**
	 * 高校就业社保补贴在线申请（数据报送）
	 * @param AAB003
	 * @param R0005R
	 * @param R0005Q
	 * @param R0005P
	 * @param R0004B
	 * @param R0004D
	 * @param AAC003
	 * @param AAC002
	 * @param AAE006
	 * @param R00048
	 * @param AAE004
	 * @param R00046
	 * @param SHZT
	 * @param SHR
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value = "/jy_zxsq",method = RequestMethod.POST)
	public  ResultSupportWork<Object> jy_zxsq(
			@ModelAttribute("Bybt")Bybt gxsb){
		ResultSupportWork<Object> result = null;
		result = wbService.commit_gxssbbt(gxsb);
		return result;
	}
	
	/**
	 * 补贴资格查询
	 */
	@ResponseBody
	@RequestMapping(value = "/query_btzg")
	public  ModelAndView query_btzg(
			@RequestParam(required = false) String dwmc,
			@RequestParam(required = false) String sbdjzh,
			@RequestParam(required = false) String yyzzh){
		ModelAndView mv = new ModelAndView();
		String lx = "JY";
		
		dwmc = helper.encodeStr(dwmc);
		sbdjzh = helper.encodeStr(sbdjzh);
		yyzzh = helper.encodeStr(yyzzh);
		
		String hm =dwmc+"※"+sbdjzh+"※"+yyzzh;
		ResultSupportWork<Object> result = wbService.send_wgbt_zgsh(lx,hm);
		mv.addObject("resultStr",result.getMessage());
		String resultCodeStr =result.getResultCode(); 
		mv.setViewName("gangweibutie_result");
		mv.addObject("passResult","不符合");
		mv.addObject("resultStr",result.getMessage());
		if(resultCodeStr!=null && resultCodeStr.length()>0){
			int resultCode = Integer.parseInt(resultCodeStr);
			if(resultCode>=0){
				mv.addObject("passResult","符合");
			}
		}
		return mv;
	}
	
	/**
	 * 岗位查询
	 */
	@ResponseBody
	@RequestMapping(value = "/query_gangwei")
	public  ModelAndView query_gangwei(
			@RequestParam(required = false) String xueli,
			@RequestParam(required = false) String didian,
			@RequestParam(required = false) String gangweiName,
			@RequestParam(required = false) String sexVal,
			HttpSession session){
		gangweiName = helper.encodeStr(gangweiName);
		//条件保存起来供加载更多的时候使用
		session.setAttribute("WORK_xueli", xueli);
		session.setAttribute("WORK_didian", didian);
		session.setAttribute("WORK_gangweiName", gangweiName);
		session.setAttribute("WORK_sexVal", sexVal);
		
		ModelAndView mv = new ModelAndView();
		//《性别》※《岗位描述》※《学历》※《工作地区》
		String hm =sexVal+"※"+gangweiName+"※"+xueli+"※"+didian;
		String paramStr = "<LX>GR3</LX><HM>"+hm+"</HM><FY>1※20</FY>";
		ResultSupportWork<Object> result =  wbService.send_hotwork_query(paramStr);
		List<GangWei> resultList = (List<GangWei>)result.getModel();
		
		mv.addObject("queryType","tiaojian");
		mv.addObject("resultList",resultList);
		mv.setViewName("list_job");
		return mv;
	}
	
	/**
	 * 岗位查询更多  
	 */
    @ResponseBody
    @RequestMapping({"/query_gangwei_more"})
    public 	ResultSupportWork<Object> query_gangwei_more(
    		@RequestParam(required = false) Integer pageNo,
    		@RequestParam String queryType,
    		HttpSession session){
	    log.info("load more data  request .....pageNo is  "+pageNo);
	    
	    String paramStr  = "";
	    if("tiaojian".equals(queryType)){
	    	String  xueli = helper.parseObjToStr(session.getAttribute("WORK_xueli"));
			String  gangweiName = helper.parseObjToStr(session.getAttribute("WORK_gangweiName"));
			String  didian = helper.parseObjToStr(session.getAttribute("WORK_didian"));
			String  sexVal = helper.parseObjToStr(session.getAttribute("WORK_sexVal"));
			String hm =sexVal+"※"+gangweiName+"※"+xueli+"※"+didian;
			paramStr = "<LX>GR3</LX><HM>"+hm+"</HM>";
	    } else if ("bigSort".equals(queryType)){
	    	String  bigSort = helper.parseObjToStr(session.getAttribute("WORK_bigSort"));
			paramStr = "<LX>GW2</LX><HM>"+bigSort+"</HM>";
	    }
	    paramStr+= "<FY>"+pageNo+"※20</FY>";
	    
		ResultSupportWork<Object> result =  wbService.send_hotwork_query(paramStr);
		return result;
	}
	
	
	/**
	 * 岗位查询 根据大类查询
	 */
	@ResponseBody
	@RequestMapping(value = "/query_gangweiBySort")
	public  ModelAndView query_gangweiBySort(@RequestParam String bigSort,
			HttpSession session){
		session.setAttribute("WORK_bigSort", bigSort);
		ModelAndView mv = new ModelAndView();
		String paramStr = "<LX>GW2</LX><HM>"+bigSort+"</HM><FY>1※20</FY>";
		ResultSupportWork<Object> result =  wbService.send_hotwork_query(paramStr);
		List<GangWei> resultList = (List<GangWei>)result.getModel();
		
		mv.addObject("queryType","bigSort");
		mv.addObject("resultList",resultList);
		mv.setViewName("list_job");
		return mv;
	}
	/**
	 * 岗位详情
	 */
	@ResponseBody
	@RequestMapping(value = "/jobDetail")
	public  ModelAndView jobDetail(@RequestParam(required = false) String detailStr ){
		System.out.println(detailStr);
		detailStr = helper.encodeStr(detailStr);
		JSONObject object = JSONObject.fromObject(detailStr.toLowerCase());
		GangWei tempobj = (GangWei)JSONObject.toBean(object,GangWei.class);
   	 	String total_renshuStrInfo  = helper.renshuInfo(tempobj.getAcb21d(),tempobj.getAcb21e(),tempobj.getAcb21f());
   	 	tempobj.setTotal_renshuStr(total_renshuStrInfo);
		ModelAndView mv = new ModelAndView();
		mv.addObject("detailObj",tempobj);
		mv.setViewName("job_detail");
		return mv;
	}
}